package com.oa.xinxi.biz;

import static org.junit.Assert.*;

import java.util.List;

import javax.annotation.Resource;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.github.pagehelper.PageHelper;
import com.oa.xinxi.entity.News;
import com.oa.xinxi.entity.Rules;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:spring.xml")
public class NewsBizTest {
	@Resource
	NewsBiz newsBiz;
	@Resource
	RulesBiz rulesBiz;
//	@Test
//	public void testSave() {
//		for (int i = 0; i < 10; i++) {
//			News news = new News();
//			news.setTitle("标题"+i);
//			news.setContent("内容"+i);
//			newsBiz.save(news);
//		}
//	}
//	@Test
//	public void testSaveRules() {
//		for (int i = 0; i < 10; i++) {
//			Rules rules = new Rules();
//			rules.setTitle("标题"+i);
//			rules.setRulesContent("内容"+i);
//			rulesBiz.save(rules);
//		}
//	}
	@Test
	public void testDeleteById() {
		fail("Not yet implemented");
	}

	@Test
	public void testUpdate() {
		fail("Not yet implemented");
	}

	@Test
	public void testFindById() {
		fail("Not yet implemented");
	}

	@Test
	public void testFindAll() {
		fail("Not yet implemented");
	}
	@Test
	public void testFindAllByPageNumSize() {
		 PageHelper.startPage(0, 3);
		List<News> list = newsBiz.findAll();
		for (News news2: list) {
			System.out.println(news2.getTitle());
		}
	}
}
